home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 25 / CU Amiga Magazine's Super CD-ROM 25 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-08].iso / CUCD / Utilities / Type1Manager / src / fontfilest.h < prev    next >
C/C++ Source or Header  |  1996-07-12  |  5KB  |  203 lines

  1. #ifndef _FONTFILEST_H_
  2. #define _FONTFILEST_H_
  3.  
  4. /**
  5.  * fontxlfd.h
  6.  **/
  7. typedef struct _FontScalable
  8. {
  9.     int pixel, point, x, y, width;
  10.     double pixel_matrix[4], point_matrix[4];
  11.     int pixel_set, point_set, horiz_weight, vert_weight;
  12.     double ShearSin, ShearCos, RotateSin, RotateCos;
  13.     Bool horiz_mirror, vert_mirror;
  14. }
  15. FontScalableRec, *FontScalablePtr;
  16.  
  17. #define FONT_XLFD_REPLACE_NONE    0
  18. #define FONT_XLFD_REPLACE_STAR    1
  19. #define FONT_XLFD_REPLACE_ZERO    2
  20. #define FONT_XLFD_REPLACE_VALUE    3
  21.  
  22.  
  23. /**
  24.  * fontfile.h
  25.  **/
  26. typedef struct _FontEntry *FontEntryPtr;
  27. typedef struct _FontTable *FontTablePtr;
  28. typedef struct _FontName *FontNamePtr;
  29. typedef struct _FontScaled *FontScaledPtr;
  30. typedef struct _FontScalableExtra *FontScalableExtraPtr;
  31. typedef struct _FontScalableEntry *FontScalableEntryPtr;
  32. typedef struct _FontScaleAliasEntry *FontScaleAliasEntryPtr;
  33. typedef struct _FontBitmapEntry *FontBitmapEntryPtr;
  34. typedef struct _FontAliasEntry *FontAliasEntryPtr;
  35. typedef struct _FontBCEntry *FontBCEntryPtr;
  36. typedef struct _FontDirectory *FontDirectoryPtr;
  37. typedef struct _FontRenderer *FontRendererPtr;
  38.  
  39. #define NullFontEntry            ((FontEntryPtr) 0)
  40. #define NullFontTable            ((FontTablePtr) 0)
  41. #define NullFontName            ((FontNamePtr) 0)
  42. #define NullFontScaled            ((FontScaled) 0)
  43. #define NullFontScalableExtra        ((FontScalableExtra) 0)
  44. #define NullFontscalableEntry        ((FontScalableEntry) 0)
  45. #define NullFontScaleAliasEntry        ((FontScaleAliasEntry) 0)
  46. #define NullFontBitmapEntry        ((FontBitmapEntry) 0)
  47. #define NullFontAliasEntry        ((FontAliasEntry) 0)
  48. #define NullFontBCEntry            ((FontBCEntry) 0)
  49. #define NullFontDirectory        ((FontDirectoryPtr) 0)
  50. #define NullFontRenderer        ((FontRendererPtr) 0)
  51.  
  52. #define FONT_ENTRY_SCALABLE    0
  53. #define FONT_ENTRY_SCALE_ALIAS    1
  54. #define FONT_ENTRY_BITMAP    2
  55. #define FONT_ENTRY_ALIAS    3
  56. #define FONT_ENTRY_BC        4
  57.  
  58. #define MAXFONTNAMELEN        1024
  59. #define MAXFONTFILENAMELEN  1024
  60.  
  61. #define FontDirFile            "fonts.dir"
  62. #define FontAliasFile       "fonts.alias"
  63. #define FontScalableFile    "fonts.scale"
  64.  
  65. typedef struct _FontName
  66. {
  67.     char *name;
  68.     short length;
  69.     short ndashes;
  70. }
  71. FontNameRec;
  72.  
  73. typedef struct _FontScaled
  74. {
  75.     FontScalableRec vals;
  76.     FontEntryPtr bitmap;
  77.     FontPtr pFont;
  78. } FontScaledRec;
  79.  
  80. typedef struct _FontScalableExtra
  81. {
  82.     FontScalableRec defaults;
  83.     int numScaled;
  84.     int sizeScaled;
  85.     FontScaledPtr scaled;
  86.     pointer private;
  87. }
  88. FontScalableExtraRec;
  89.  
  90. typedef struct _FontScalableEntry
  91. {
  92.     FontRendererPtr renderer;
  93.     char *fileName;
  94.     FontScalableExtraPtr extra;
  95. }
  96. FontScalableEntryRec;
  97.  
  98.  
  99. /*
  100.  * This "can't" work yet - the returned alias string must be permanent,
  101.  * but this layer would need to generate the appropriate name from the
  102.  * resolved scalable + the XLFD values passed in.  XXX
  103.  */
  104. typedef struct _FontScaleAliasEntry
  105. {
  106.     char *resolved;
  107. }
  108. FontScaleAliasEntryRec;
  109.  
  110. typedef struct _FontBitmapEntry
  111. {
  112.     FontRendererPtr renderer;
  113.     char *fileName;
  114.     FontPtr pFont;
  115. }
  116. FontBitmapEntryRec;
  117.  
  118. typedef struct _FontAliasEntry
  119. {
  120.     char *resolved;
  121. }
  122. FontAliasEntryRec;
  123.  
  124. typedef struct _FontBCEntry
  125. {
  126.     FontScalableRec vals;
  127.     FontEntryPtr entry;
  128. } FontBCEntryRec;
  129.  
  130. typedef struct _FontEntry
  131. {
  132.     FontNameRec name;
  133.     int type;
  134.     union _FontEntryParts
  135.     {
  136.         FontScalableEntryRec scalable;
  137.         FontBitmapEntryRec bitmap;
  138.         FontAliasEntryRec alias;
  139.         FontBCEntryRec bc;
  140.     } u;
  141. } FontEntryRec;
  142.  
  143. typedef struct _FontTable
  144. {
  145.     int used;
  146.     int size;
  147.     FontEntryPtr entries;
  148.     Bool sorted;
  149. }
  150. FontTableRec;
  151.  
  152. typedef struct _FontDirectory
  153. {
  154.     char *directory;
  155.     unsigned long dir_mtime;
  156.     unsigned long alias_mtime;
  157.     FontTableRec scalable;
  158.     FontTableRec nonScalable;
  159. }
  160. FontDirectoryRec;
  161.  
  162. typedef struct _FontRenderer
  163. {
  164.     char *fileSuffix;
  165.     int fileSuffixLen;
  166.     int (*OpenBitmap) ( /* fpe, pFont, flags, entry, fileName, format, fmask */ );
  167.     int (*OpenScalable) ( /* fpe, pFont, flags, entry, fileName, vals, format, fmask */ );
  168.     int (*GetInfoBitmap) ( /* fpe, pFontInfo, entry, fileName */ );
  169.     int (*GetInfoScalable) ( /* fpe, pFontInfo, entry, fileName, vals */ );
  170.     int number;
  171. }
  172. FontRendererRec;
  173.  
  174. typedef struct _FontRenders
  175. {
  176.     int number;
  177.     FontRendererPtr *renderers;
  178. }
  179. FontRenderersRec, *FontRenderersPtr;
  180.  
  181. typedef struct _BitmapInstance
  182. {
  183.     FontScalableRec vals;
  184.     FontBitmapEntryPtr bitmap;
  185. } BitmapInstanceRec, *BitmapInstancePtr;
  186.  
  187. typedef struct _BitmapScalablePrivate
  188. {
  189.     int numInstances;
  190.     BitmapInstancePtr instances;
  191. }
  192. BitmapScalablePrivateRec, *BitmapScalablePrivatePtr;
  193.  
  194. typedef struct _BitmapSources
  195. {
  196.     FontPathElementPtr *fpe;
  197.     int size;
  198.     int count;
  199. }
  200. BitmapSourcesRec, *BitmapSourcesPtr;
  201.  
  202. #endif /* _FONTFILEST_H_ */
  203.